using UnityEngine;
using UnityEngine.SceneManagement;

namespace CardGameObject.GameScene
{
    public class GameMenu : MonoBehaviour
    {
        public Canvas Menu;
        // Start is called before the first frame update
        private void Start()
        {
            Menu.enabled = false;
        }

        public void OnResume()
        {
            Menu.enabled = false;
        }

        public void OnExit()
        {
            SceneManager.LoadScene("MainScene");
        }

        public void OnHome()
        {
            SceneManager.LoadScene("MainScene");
        }

        // 新增方法，处理ESC键点击事件
        private void Update()
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Menu.enabled = !Menu.enabled;
            }
        }
    }
}
